package dyyx.demo;

import java.util.ArrayList;
import java.util.List;

import com.netflix.loadbalancer.BaseLoadBalancer;
import com.netflix.loadbalancer.ILoadBalancer;
import com.netflix.loadbalancer.Server;

public class LoadBlanceDemo {

	public static void main(final String[] args) {

		ILoadBalancer balancer = new BaseLoadBalancer();
    	List<Server> servers = new ArrayList<Server>();
    	servers.add(new Server("localhost", 8080));
    	servers.add(new Server("localhost", 8081));
    	balancer.addServers(servers);
    	
    	
    	for(int i=0;i<10;i++){
    		Server choosedServer = balancer.chooseServer(null);
    		System.out.println(choosedServer);
    	}

	}

	

}
